﻿using Autofac;
using GC_RF.DataAccess.Modules.Autofac;
using GC_RF.Domain.Abstractions.Interfaces.Factories;
using GC_RF.Domain.Factories;

namespace GC_RF.Domain.Modules.Autofac
{
	public class DomainModule : Module
	{
		protected override void Load(ContainerBuilder builder)
		{
			base.Load(builder);

			builder.RegisterModule(new DataAccessModule());

			builder.RegisterType<HelperFactory>().As<IHelperFactory>().SingleInstance();

			//Dependencies: IUnitOfWork, IRepositoryFactory, IHelperFactory
			builder.RegisterType<ServiceFactory>().As<IServiceFactory>().SingleInstance();

			////Dependencies: Application, IEqualityComparer<StoreData>
			//builder.RegisterType<OutlookDataService>().As<IOutlookDataService>()
			//	.WithParameter("outlookApplication", _application)
			//	.WithParameter(
			//		(p, c) => p.ParameterType == typeof(IEqualityComparer<StoreData>),
			//		(p, c) => c.Resolve<ComparerBaseFactory>().CreateMainInfoStoreDataComparer())
			//	.SingleInstance();
		}
	}
}
